home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Periodicals / develop / develop 4 code / C++ Driver / iacDriver / TMessage.h < prev   
Encoding:
C/C++ Source or Header  |  1990-05-28  |  1.6 KB  |  50 lines  |  [TEXT/MPS ]

  1. #ifndef     __TMessage__
  2. #define    __TMessage__
  3.  
  4. #include    <Types.h>
  5. #include    <Traps.h>
  6. #include    <Files.h>
  7. #include    <Devices.h>
  8.  
  9.  
  10. class TMessage {
  11. public:
  12.                 /* Constructor and destructor.  Constructor will build the message
  13.                  * with the appropriate data members passed in. */
  14.                 TMessage(char    *message, short senderSig, short receiverSig);
  15.                 ~TMessage();
  16.                 
  17.                 /* Two boolean functions which just query the message to see 
  18.                  * if the message is destined for the signature of the 
  19.                  * Requestor.  Nice example of function overloading -- in the 
  20.                  * one case I just wanted to return true or false, in the other
  21.                  * case I wanted to return who the message was from and the actual
  22.                  * message string.  This is also nice because we only have one 
  23.                  * public member function returning any private information. */
  24.     Boolean    IsMessageForMe(short    sigOfRequestor);
  25.     Boolean    IsMessageForMe(short sigOfRequestor, short *senderSig, char *messageString);
  26.     
  27. private:
  28.     /* GetSenderSig returns fSenderSig.
  29.      * SetSenderSig sets fSenderSig to signature.    */
  30.     short        GetSenderSig();
  31.     void        SetSenderSig(short signature);
  32.     
  33.     /* GetReceiverSig returns fReceiverSig.
  34.      * SetReceiverSig sets fReceiverSig to signature.    */
  35.     short        GetReceiverSig();
  36.     void        SetReceiverSig(short signature);
  37.     
  38.     /* GetMessageString returns fMessageString.
  39.      * SetMessageString sets fMessageString to msgString.    */
  40.     char        *GetMessageString();
  41.     void        SetMessageString(char *msgString);
  42.     
  43.     // private data members.  Again, we keep the storage for the string here.
  44.     short            fSenderSig;
  45.     short            fReceiverSig;
  46.     char            fMessageString[255];
  47. };
  48.  
  49. typedef    TMessage    *TMessPtr;
  50. #endif